//
//  XCAFNetTool.h
//  SourceOfNature
//
//  Created by 梁新昌 on 16/3/7.
//  Copyright © 2016年 梁新昌. All rights reserved.
//

#import <Foundation/Foundation.h>



typedef void (^BlockOfSuccess) (id result);

typedef NS_ENUM(NSUInteger, XCResponseStyle) {
    XCJSON,
    XCXML,
    XCDATA,
    
};
typedef NS_ENUM(NSUInteger, XCRequestStyle) {
    XCRequestJSON,
    XCRequestString,
};

@interface XCAFNetTool : NSObject

//@property (nonatomic, copy) NSString *path;

+(void)GETNetWithUrl:(NSString *)url body:(id)body
          headerFile:(NSDictionary *)header
            response:(XCResponseStyle)responseStyle
             success:(BlockOfSuccess)success
             failure:(void (^)(NSError * error))failure;

+(void)POSTNetWithUrl:(NSString *)url body:(id)body
            bodyStyle:(XCRequestStyle)bodyRequestStyle
           headerFile:(NSDictionary *)header
             response:(XCResponseStyle)responseStyle
              success:(BlockOfSuccess)success
              failure:(void (^)(NSError * error))failure;



@end
